$(document).ready(function () {
    var ttp=new Vue({
        el:"#ttp",
        data:{lists:[]}
    })
    var ttp2=new Vue({
        el: "#ttp2",
        data:{lists:[]}

    })
    var tob1=new Vue({
        el:"#tob1",
        data:{lists:[]}
    })
    var tob2=new Vue({
        el:"#tob2",
        data:{lists:[]}
    })

    var listload=[];
    var listload2=[];
    $.ajax({
        type:"Get",
        url:"./data/ttp.json",
        success:function (re) {
            ttp.lists=re.lists;
        }
    })
    $.ajax({
        type:"Get",
        url:"./data/ttp2.json",
        success:function (re) {
            ttp2.lists=re.lists;
        }
    })
    $.ajax({
        type:"Get",
        url:"./data/sales.json",
        success:function (re) {
            for(var i=0;i<16;i++){
                var x=i+16;
                listload.push(re.lists[i]);
                listload2.push(re.lists[x]);
            }
            tob1.lists=listload;
            tob2.lists=listload2;
        }
    })
    $.ajax({
        type:"Get",
        url:"./data/sales2.json",
        success:function (re) {
            var yAxisData=[];
            var seriesData1=[];
            var seriesData2=[];
            for(var i=0;i<8;i++){
                yAxisData.push(re.lists[i].name);
                seriesData1.push(re.lists[i].month);
                seriesData2.push(re.lists[i].day);
            }
            var myChart = echarts.init(document.getElementById('tip1'));
            var option = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                        type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                grid: {
                    left: '10px',
                    right: '10px',
                    bottom: '7px',
                    top:'16px',
                    containLabel: true
                },
                xAxis:  {
                    type: 'value'
                },
                yAxis: {
                    type: 'category',
                    data: yAxisData
                },
                series: [
                    {
                        name: '当月',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#DC3428'},
                        data: seriesData1
                    },
                    {
                        name: '当日',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#E97212'},
                        data: seriesData2
                    }
                ]
            };
            myChart.setOption(option);
        }
    })
    $.ajax({
        type:"Get",
        url:"./data/sales2.json",
        success:function (re) {
            var yAxisData=[];
            var seriesData1=[];
            var seriesData2=[];
            for(var i=0;i<8;i++){
                var x=i+8;
                yAxisData.push(re.lists[x].name);
                seriesData1.push(re.lists[x].month);
                seriesData2.push(re.lists[x].day);
            }
            var myChart = echarts.init(document.getElementById('tip2'));
            var option = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                        type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                grid: {
                    left: '10px',
                    right: '10px',
                    bottom: '7px',
                    top:'16px',
                    containLabel: true
                },
                xAxis:  {
                    type: 'value'
                },
                yAxis: {
                    type: 'category',
                    data: yAxisData
                },
                series: [
                    {
                        name: '当月',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#DC3428'},
                        data: seriesData1
                    },
                    {
                        name: '当日',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#E97212'},
                        data: seriesData2
                    }
                ]
            };
            myChart.setOption(option);
        }
    })
    $.ajax({
        type:"Get",
        url:"./data/sales2.json",
        success:function (re) {
            var yAxisData=[];
            var seriesData1=[];
            var seriesData2=[];
            for(var i=0;i<8;i++){
                var x=i+16;
                yAxisData.push(re.lists[x].name);
                seriesData1.push(re.lists[x].month);
                seriesData2.push(re.lists[x].day);
            }
            var myChart = echarts.init(document.getElementById('tip3'));
            var option = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                        type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                grid: {
                    left: '10px',
                    right: '10px',
                    bottom: '7px',
                    top:'16px',
                    containLabel: true
                },
                xAxis:  {
                    type: 'value'
                },
                yAxis: {
                    type: 'category',
                    data: yAxisData
                },
                series: [
                    {
                        name: '当月',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#DC3428'},
                        data: seriesData1
                    },
                    {
                        name: '当日',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#E97212'},
                        data: seriesData2
                    }
                ]
            };
            myChart.setOption(option);
        }
    })
    $.ajax({
        type:"Get",
        url:"./data/sales2.json",
        success:function (re) {
            var yAxisData=[];
            var seriesData1=[];
            var seriesData2=[];
            for(var i=0;i<8;i++){
                var x=i+24;
                yAxisData.push(re.lists[x].name);
                seriesData1.push(re.lists[x].month);
                seriesData2.push(re.lists[x].day);
            }
            var myChart = echarts.init(document.getElementById('tip4'));
            var option = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                        type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                grid: {
                    left: '10px',
                    right: '10px',
                    bottom: '7px',
                    top:'16px',
                    containLabel: true
                },
                xAxis:  {
                    type: 'value'
                },
                yAxis: {
                    type: 'category',
                    data: yAxisData
                },
                series: [
                    {
                        name: '当月',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#DC3428'},
                        data: seriesData1
                    },
                    {
                        name: '当日',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        itemStyle:{color:'#E97212'},
                        data: seriesData2
                    }
                ]
            };
            myChart.setOption(option);
        }
    })

    $.ajax({
        type:"Get",
        url:"./data/sub.json",
        success:function (re) {
            var x=re.lists; //这是一字符串
            
            $array = str_split('16581026105', 2);
        }
    })
})